package com.sktk.keepAccount.rest;

import com.sktk.keepAccount.annotation.Decrypt;
import com.sktk.keepAccount.common.core.vo.Result;
import com.sktk.keepAccount.entity.param.FeedbackSubmitParam;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;

@RestController
@RequestMapping("/feedback")
public class FeedbackController {

    /**
     * 反馈提交
     *
     * @param request
     * @param param
     * @return
     * @throws Exception
     */
    @ResponseBody
    @RequestMapping(value = "/submit", method = RequestMethod.POST)
    public String submit(HttpServletRequest request,
                               @Valid @RequestBody @Decrypt FeedbackSubmitParam param) throws Exception {

        String content = param.getContent();

        System.out.println("content=" + content);

//        Feedback feedback = new Feedback();
//        feedback.setAppId(jwtInfo.getAppId());
//        feedback.setCustomerId(jwtInfo.getCustomerId());
//        feedback.setChannel(param.getChannel());
//        feedback.setVersion(param.getVersion());
//        feedback.setContent(content);
//        feedbackMapper.insert(feedback);

        return Result.success(content);
    }
}
